<template>
   <div class="left-list-main">
     <ul class="top-list">
       <li class="header">{{ details.title }}团队</li>
       <li class="item active" >团队成员</li>
       <li class="item " >
         <router-link :to="`list?moduleType=9eacb2c4-cbfe-488c-aefd-f6268781c8e7&teamId=${details.id}`">团队新闻</router-link>
       </li>
<!--       <li class="item" >团队成果</li>-->
     </ul>
     <ul class="bottom-list">
       <li class="title">{{ details.title }}团队热点新闻</li>
       <li class="item" @click="clickItem" v-for="(item,index) in hotNews" :key="index">
         <p class="item-title line-2" >{{ $TOOL.richTextWithUrlsRemove(item.title) }}</p>
         <p class="time">{{$TOOL.dateFormat(item.createDate,'YYYY-MM-DD')}}</p>
       </li>
     </ul>
   </div>
</template>

<script setup>
import {homeApi} from "@/api";

const details=ref({})
const hotNews=ref([])
async function getTeamLstPage(data){
  details.value=data
  const sendData={
    type:2,
    index:1,
    teamId:data.id
  }
  const res=await  homeApi.listPage.get(sendData)
  hotNews.value=res.data.sources
}
const router=useRouter()
function clickItem(item){
  router.push({
    path:`details?type=1&id=${ item.id}`
  })
}
defineExpose({getTeamLstPage})
</script>

<style scoped lang="scss">
.left-list-main{
  min-width: 200px;
  width: 21%;
  .top-list{
    background: #FFFFFF;
    margin-bottom: 16px;
    padding-bottom: 32px;
    .header{
      width: 100%;
      padding: 10px 20px;
      background: $base-color;
      font-size: 32px;
      font-weight: bold;
      color: #FFFFFF;
      margin-bottom: 32px;
    }
    .item{
      padding: 0 20px;
      margin-bottom: 22px;
      color: #333333;
      font-size: 20px;
      display: flex;
      cursor: pointer;
      align-items: center;
      &.active{
        color: $base-color;
        font-size: 20px;
        font-weight: bold;
        &:hover{
          &:before{
            width: 10px;
            height: 10px;
          }
        }
        &:before{
          background: $base-color;
          width: 10px;
          height: 10px;
        }
      }
      &:hover{
        color: $base-color;
        a{
          color: $base-color;
          font-weight: bold;
        }
        &:before{
          background: $base-color;
          width: 6px;
          height: 6px;
        }
      }
      &:before{
        content: '';
        display: block;
        width: 4px;
        height: 4px;
        background: #999999;
        margin-right: 6px;
        transition: all .1s ease-in-out;
      }
    }
  }
  .bottom-list{
    background: #FFFFFF;
    .title{
      padding: 20px  10px;
      font-size: 20px;
      font-weight: bold;
      color: $base-color;
      border-bottom: 1px solid #c4c7c7;
    }
    .item{
      padding: 20px 10px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      border-bottom: 1px solid #f2f2f2;
      cursor: pointer;
      &:hover{
        font-weight: bold;
        .item-title{
          color: $base-color;
        }
      }
      &:last-child{
        border-bottom: 0px;
      }
      .item-title{
        font-size: 20px;
        color: #333333;
      }
      .time{
        font-size: 16px;
        color: #999999;
      }
    }
  }
}
</style>
